import http from '../utils/request'
import {AxiosResponse} from 'axios'
interface Iadmin{
  (admin_name:string,pwd:string):Promise<AxiosResponse<any>>
}
interface Ilist{
  (page:number,pageSize:number,idorname?:string):Promise<AxiosResponse<any>>
}


const login:Iadmin = (admin_name:string,pwd:string):Promise<AxiosResponse<any>> => {
  return http.post('/admin/login', {admin_name,pwd})
}
const list:Ilist=(page:number,pageSize:number,idorname?:string):Promise<AxiosResponse<any>> => {
  return http.get('/admin/list', {page,pageSize,idorname})
}

export default {
    login,
    list
}